﻿using RpcCentral.Model;
using RpcCentral.Model.DB;
using SqlSugarHelper;

namespace RpcCentral.DAL.Repository
{
    internal class RpcControlListDAL : IRpcControlListDAL
    {
        private IRepository<RpcControlList> _Db;
        public RpcControlListDAL(IRepository<RpcControlList> db)
        {
            _Db = db;
        }
        public RpcControl[] GetControlServer()
        {
            return this._Db.GetAll(c => new RpcControl
            {
                Id = c.Id,
                Port = c.Port,
                RegionId = c.RegionId,
                ServerIp = c.ServerIp
            });
        }
    }
}
